package com.tju.backend.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

@Data
@NoArgsConstructor
public class SysUser implements Serializable {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户名
     */
    @NotNull(message = "登录名不能为空")
    private String loginName;

    /**
     * 密码
     */
    @NotNull(message = "密码不能为空")
    private String loginPassword;

    /**
     * 用户名
     */
    @NotNull(message = "用户名不能为空")
    private String userName;

    /**
     * 创建日期
     */
    public Date byTime;

    /**
     * 邮箱
     */
    private String email;

    /**
     * 角色
     */
    @TableField(exist = false)
    private Long power;

    @TableField(exist = false)
    private SysRole roles;

    public SysUser(String s) {
        this.userName = s;
    }

}